package org.gitman.filmBase.view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.swing.JPanel;

import org.apache.log4j.Logger;
import org.gitman.filmBase.view.tools.ResourcesLoader;

public class ImagePanel extends JPanel{
	
	private BufferedImage image;
	private static Logger logger = Logger.getLogger(ResourcesLoader.class);
	
	public ImagePanel(String imageName){
		super();		
		setBackground(new Color(0,0,0,0));
		try {
			image = ResourcesLoader.getInstance().getImage(imageName);
		} catch (IOException e) {
			logger.debug("loading image: " + imageName, e);
		}
	}
	
	public void paint(Graphics g){
		super.paint(g);
		g.drawImage(image, 0, 0, null);		
	}
}
